<?
// Core.php
// written by: David Fudge [ rkstar@mac.com ]
// created on: November 1, 2008
// last modified: November 1, 2008
//
// description:
// this is a core class that all classes in our ed framework will extend.

// load the dependencies here
ed::load("Core.Object");
ed::load("Core.Form");
ed::load("Core.Error");
ed::load("Core.Utils");
ed::load("Data.XML");

class Core
{
	private $isDebug;		// boolean debugging mode
	public $form;			// _REQUEST, _GET, _POST form submission
	public $xml;			// xml form submission
	public $error;			// instance of error object

	// constructor
	public function __construct()
	{
		$this->debugMode(false);
		// instantiate the error, form, and xml objects
		$this->error = new Error();
		$this->form  = new Form();
		if( !$_POST && !$_GET && !$_REQUEST )
		{
			$input = file_get_contents("php://input");
			$this->xml   = (strlen($input)>0) ? new XML($input) : null;
		}
	}

	// debugging functions
	public function debugMode( $bool=true ) { $this->isDebug = $bool; }
	public function debug() { return $this->isDebug; }
	public function showDebug() { print "<pre>".print_r($this,true)."</pre>"; }
}
?>